/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mall.db.dao;

import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.TypedQuery;
import mall.db.entities.Client;
import mall.db.entities.TheOrder;

/**
 *
 * @author Iaroslav_Mazai
 */
public class TheOrderDAO extends JpaDAO<TheOrder> {

	@Override
	public Class<TheOrder> getEntityClass() {
		return TheOrder.class;
	}

	public List<TheOrder> getOrdersOfClient(Client client) {
		EntityManager em = getEntityManager();
		TypedQuery query = em.createQuery("SELECT o FROM TheOrder o", TheOrder.class);
		return query.getResultList();
	}
}
